import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/user',
    children:[
      {path: '/order',name: 'order', component: () => import('../views/order/order.vue')},
      {path: '/user',name: 'user', component: () => import('../views/user/user.vue')},
      {path: '/teacher',name: 'teacher', component: () => import('../views/teacher/teacher.vue')},
      {path: '/course',name: 'course', component: () => import('../views/course/course.vue')},
      {path: '/free',name: 'free', component: () => import('../views/course/free.vue')},
      {path: '/premium',name: 'premium', component: () => import('../views/course/premium.vue')},
      {path:'/header',name:"header",component:()=>import("../views/firstPage/header.vue")},
    ],
  },
  {path: '/login',name: 'about', component: () => import('../views/login.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
